﻿using System.Web.Mvc;
using System.Web.Routing;
using CSF.Utility.Mvc;

namespace CSF.WebApp.Admin.Areas.WebShop
{
    public class WebShopAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "WebShop";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            SecureRoute route = new SecureRoute(
                "WebShop/{appCode}/{controller}/{action}/{id}",
                new RouteValueDictionary(new { appCode = "Sail", controller = "Promotion", action = "Index", id = UrlParameter.Optional }),
                new MvcRouteHandler(), context.AreaName);
            context.Routes.Add("WebShop_default", route);
            //context.MapRoute(
            //    "WebShop_default",
            //    "WebShop/{controller}/{action}/{id}",
            //    new { action = "Index", id = UrlParameter.Optional }
            //);
        }
    }
}
